home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / GLX / rubberband / main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  1.9 KB  |  65 lines

  1. /*
  2.  * Copyright 1992, 1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17.  
  18. #include <X11/Intrinsic.h>
  19. #include <X11/StringDefs.h>
  20. #include <Xm/Frame.h>
  21.  
  22. String fallback_resources[] = {
  23.     "*geometry: =400x400",
  24.     "*frame*shadowType: SHADOW_IN",
  25.     NULL
  26. };
  27.  
  28. static XtAppContext app_context;
  29.  
  30. Widget initGLWidgetWithOverlay(Widget);
  31.  
  32. main(argc, argv)
  33. int argc;
  34. char *argv[];
  35. {
  36.     long width, height;
  37.     Arg args[20];
  38.     int n = 0;
  39.     Widget toplevel, frame, glw;
  40.     XtTranslations transTable;
  41.  
  42.     toplevel = XtAppInitialize(&app_context, "RubberBand",
  43.                                (XrmOptionDescList)NULL, 0, 
  44.                                (Cardinal*)&argc,
  45.                                (String*)argv,
  46.                                fallback_resources,
  47.                                (ArgList)NULL, 0);
  48.     n = 0;
  49.     XSynchronize(XtDisplay(toplevel), True);
  50.     frame = XtCreateManagedWidget("frame", xmFrameWidgetClass,
  51.                                   toplevel, args, n);
  52.  
  53.     glw = initGLWidgetWithOverlay(frame);
  54.  
  55.     XtManageChild(glw);
  56.     XtManageChild(frame);
  57.     XtRealizeWidget(toplevel);
  58.     installColormapWithOverlay(toplevel, glw);
  59.     installColormap(toplevel, glw);
  60.     GLXwinset(XtDisplay(glw), XtWindow(glw));
  61.     frontbuffer(TRUE);
  62.     gflush();
  63.     XtAppMainLoop(app_context);
  64. }
  65.